<template>
  <div>
      <h1 @click="say" v-for="item in list" :key="item">{{item}}</h1>
      <h1>{{myhobby}}</h1> 

      <h1>{{kname}}</h1>
  </div>
</template>

<script>
import Vue from 'vue'
import myTheme from '../Mixins/theme'
// 
// let  state = Vue.observable({ count: 0 })


// 如果混入和组件内部的数据和方法冲突的时候
// 优先执行组件的数据和方法
export default {
  name: 'Home',
  // 局部混入
  mixins:[myTheme],
  data(){
    return {
      kname:""
    }
  },
  created(){

  },
  methods: {
    say(){
      // state.count++
      alert("新加坡"+this.kname)
    }
  },
  computed:{},
  mounted() {
    console.log("挂载完毕了")
        // 接收broOne传来的值
    this.$bus.$on('sendhdata',(val)=>{
      console.log(val)
       this.kname=val;
       console.log(this.kname,"----")
    })
  },

}
</script>
